package com.yyryyty.chapter2;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;

/**
 * @Description :
 * @Author : YTY
 * @Date : 2021-01-15 18:34
 */
public class FilteringNumbers {

    public static void main(String[] args) {

        List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

        System.out.println(numbers.stream()
                .filter(i -> i % 2 == 0)
                .collect(toList()));
    }
}
